package com.stylefeng.guns.config;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.stylefeng.guns.core.util.clm.AdminConstant;

/**
 * Created by qingyunzhang on 2018/4/3.
 * 用于封装两套单点类库方法，如用到其他方法，请在此类追加
 */
public class AuthUtil {

    /*protected static Logger logger = LoggerFactory.getLogger(AuthUtil.class);

    public static String getUser(HttpServletRequest request,HttpServletResponse response){
        String tenantId = AdminConstant.DEFAULT_SITEID;
        logger.info("getUser=========tenantId===="+tenantId);
        if(!"002".equals(tenantId)){
            try{
                //{"loginuser":"142326198203111237","usertype":"0","userid":1422875}
            	String userinfo=PassportClientUtil.getUser(request,response);
            	logger.info("loginuser========="+userinfo);
                return userinfo;
                
//                return SsoUtil.getUser(request);
            }catch (Exception e) {
                e.printStackTrace();
            }
        }else{
            try{
                //{"userid":1422875}
                return SsoUtil.getUser(request);
            }catch (JiashengApiException e) {
                e.printStackTrace();
            } catch (JiashengOAuthException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    public static void logOut(HttpServletRequest request, HttpServletResponse response){
    	
    }*/

}
